import React, { Component } from 'react'
import { Tabs, WhiteSpace } from 'antd-mobile';
import Top from "./compon/top.js"
import { withRouter } from "react-router-dom"
// import { unstable_Tabs as Tabs } from '@ant-design/mobile'
export default withRouter(class Collection extends Component {
    componentDidMount() {
        if (this.props.location.state.props.flag) {
            this.props.history.replace("/login")
        }
    }
    state = {
        tabs2: [
            { title: '咨询', sub: '1' },
            { title: '问答', sub: '2' },
            { title: '楼盘', sub: '3' },
        ]
    }
    hist = () => {
        // console.log( this.props.history)
        this.props.history.goBack()
    }
    render() {
        return (
            <>
                <Top hist={this.hist} value={"我的点评"} />
                <div>
                    <WhiteSpace />
                    <div>
                        <WhiteSpace />
                        <Tabs tabs={this.state.tabs2}
                            initialPage={1}

                            tabBarPosition="top"
                            renderTab={tab => <span>{tab.title}</span>}
                        >
                            <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: '#f5f5f9' }}>
                                Content of first tab
                            </div>
                            <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: '#f5f5f9' }}>
                                Content of second tab
                            </div>
                            <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', backgroundColor: '#f5f5f9' }}>
                                Content of third tab
                            </div>
                        </Tabs>
                        <WhiteSpace />
                    </div>
                </div>
            </>
        )
    }
})
